<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8"/>
	<meta name="keywords" content="Outline"/>
	<link rel="stylesheet" href="../../Shared/sty/standard.css"/>
	<script defer src="../../Shared/js/toc.js"></script>
	
	<title>Define Outline extraction rules in CotEditor on Mac</title>
</head>

<body>
<a name="syntax_outline_settings"></a>

<h1>Define Outline extraction rules in CotEditor on Mac</h1>

<p>Define the patterns to extract items in the document for the <a href="howto_show_outlinemenu.html">Outline feature</a>.</p>

<p>To define the rules to extract the outline for a syntax, select Outline from the list on the left of the syntax editor, then add conditions to the list on the right side. See <a href="syntax_definition.html">Define a syntax</a> for how to open the syntax editor.</p>


<section>
<p>The options for the Outline settings are as follows:</p>

<table>
	<thead>
		<tr><th>Field</th><th>Description</th></tr>
	</thead>
	<tbody>
		<tr><th>Regular Expression String</th><td>The strings in the document matched by the regular expressions you set here appear in the outline menu. This setting is required to search the items to be listed.</td></tr>
		<tr><th>IC</th><td>If selected, the case is ignored for searching. For example, the expression “abc” matches “ABC” or “abc” or “Abc” in your document (IC stands for Ignore Case).</td></tr>
		<tr><th>Title Pattern</th><td>Here, you can format the titles of the Outline items. Both the Regular Expression Pattern setting and the setting here determine how the corresponding item is titled in the list. You can also make them bold, italic, or underlined.</td></tr>
	</tbody>
</table>

<p>The metacharacters you can use in the Title Pattern are as follows:</p>

<table>
	<thead>
		<tr><th>Metacharacter</th><th>Description</th></tr>
	</thead>
	<tbody>
		<tr><th>(blank)</th><td>The whole string matched by your regular expression.</td></tr>
		<tr><th><code>$0</code></th><td>The whole string matched by your regular expression.</td></tr>
		<tr><th><code>$1</code> ... <code>$9</code></th><td>The string matched by the first through ninth parenthesized subexpression in your regular expression.</td></tr>
		<tr><th><code>-</code></th><td>A separator of the menu (invalid when other letters than “-” are included).</td></tr>
	</tbody>
</table>

<p>To show a metacharacter such as “$0” in the menu, you need to put a backslash (&#x005C;) in front of it. You won’t see that backslash (&#x005C;) in the menu.</p>
</section>


<section id="cf">
<h2>See also</h2>
<ul>
	<li><a href="howto_show_outlinemenu.html">Inspect the outline of a document</a></li>
	<li><a href="syntax_definition.html">Define a syntax</a></li>
	<li><a href="about_regex.html">Use the regular expression</a></li>
</ul>
</section>

</body>
</html>
